package com.mes.schedule.ScheduleOperation.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.BatchSize;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.context.annotation.Lazy;

import com.mes.common.domain.BasicModel;



/**
 * 分批事件 2017-03-12 <br/>
 * 
 * @author lcs
 * @version
 * @since JDK 1.8
 */
@Entity()
@org.hibernate.annotations.Entity(dynamicInsert=false,dynamicUpdate=false)
@Table(name = "T_OPERATION_PARTTASK")
@BatchSize(size=20)
@Lazy(value=true)
public class OperationPartTask extends BasicModel {

	/**
	 * 唯一号
	 */
	@Id
	@GenericGenerator(name = "scheduleOperationUid", strategy = "assigned")
	@Column(name="UNIQUEID")
	private String scheduleOperationUid;
	
	@Override
	public String getUuid() {
		return scheduleOperationUid;
	}

	@Override
	public void setUuid(String uuid) {
		this.scheduleOperationUid = uuid;
	}
	
	/**
	 * 应该处理该事件的调度方案唯一号
	 */
	@Column(name="SCHEDULEUID")
	private String scheduleUid;

	@Column(name="TASKUID")
	private String taskUid;

	@Column(name="EARLYSTART",length=7)
	protected Date earlyStart;
	
	@Column(name="LATEFINISH",length=7)
	protected Date lateFinish;

	// add by hba
	/**
	 * 实际开始
	 */
	@Column(name="ACTUALSTART",length=7)
	protected Date actualStart;
	
	/**
	 * 实际结束
	 */
	@Column(name="ACTUALFINISH",length=7)
	protected Date actualFinish;

	@Column(name="DEPTID")
	protected String deptUid;
	
	@Column(name="MODEL")
	private String model;
	
	@Column(name="PART_NUMBER")
	protected String partUid;
	
	@Column(name="PARTNAME")
	private String partName;

	@Column(name="DRAWINGID")
	protected String drawingId;
	
	@Column(name="BATCHNUM")
	protected String batchNum;

	@Column(name="PLANGRADE", precision=10,scale=0)
	protected Integer planGrade;
	
	@Column(name="PARENTOPUNIQUEID")
	private String parentUniqueId;

	/**
	 * 是否关键件,改成Integer支持多个关键级别
	 */
	@Column(name="ISCRITICAL")
	protected Integer isCritical;
	
	/**
	 * 计划数
	 */
	@Column(name="PLANQTY")
	protected Double planQty;
	
	/**
	 * 完成数
	 */
	@Column(name="COMPLETEQTY")
	protected Double completeQty = 0d;

	@Column(name="DELAYCOST")
	protected Integer delayCost = 300;


	public Integer getDelayCost() {
		return delayCost == null ? 300 : delayCost;
	}

	public void setDelayCost(Integer delayCost) {
		this.delayCost = delayCost;
	}



	public String getScheduleOperationUid() {
		return scheduleOperationUid;
	}

	public void setScheduleOperationUid(String scheduleOperationUid) {
		this.scheduleOperationUid = scheduleOperationUid;
	}


	public String getScheduleUid() {
		return scheduleUid;
	}

	public void setScheduleUid(String scheduleUid) {
		this.scheduleUid = scheduleUid;
	}

	public String getTaskUid() {
		return taskUid;
	}

	public void setTaskUid(String taskUid) {
		this.taskUid = taskUid;
	}


	public Date getEarlyStart() {
		return earlyStart;
	}

	public void setEarlyStart(Date earlyStart) {
		this.earlyStart = earlyStart;
	}


	public Date getLateFinish() {
		return lateFinish;
	}

	public void setLateFinish(Date lateFinish) {
		this.lateFinish = lateFinish;
	}


	public Date getActualStart() {
		return actualStart;
	}

	public void setActualStart(Date actualStart) {
		this.actualStart = actualStart;
	}


	public Date getActualFinish() {
		return actualFinish;
	}

	public void setActualFinish(Date actualFinish) {
		this.actualFinish = actualFinish;
	}


	public String getDeptUid() {
		return deptUid;
	}

	public void setDeptUid(String deptUid) {
		this.deptUid = deptUid;
	}


	public String getPartUid() {
		return partUid;
	}

	public void setPartUid(String partUid) {
		this.partUid = partUid;
	}


	public String getDrawingId() {
		return drawingId;
	}

	public void setDrawingId(String drawingId) {
		this.drawingId = drawingId;
	}

	

	public String getBatchNum() {
		return batchNum;
	}

	public void setBatchNum(String batchNum) {
		this.batchNum = batchNum;
	}


	public Integer getPlanGrade() {
		return planGrade;
	}

	public void setPlanGrade(Integer planGrade) {
		this.planGrade = planGrade;
	}
	

	public Double getPlanQty() {
		return planQty;
	}

	public void setPlanQty(Double planQty) {
		this.planQty = planQty;
	}


	public Double getCompleteQty() {
		return completeQty;
	}

	public void setCompleteQty(Double completeQty) {
		this.completeQty = completeQty;
	}
	

	public Integer getIsCritical() {
		return isCritical;
	}

	public void setIsCritical(Integer isCritical) {
		this.isCritical = isCritical;
	}


	public String getParentUniqueId() {
		return parentUniqueId;
	}

	public void setParentUniqueId(String parentUniqueId) {
		this.parentUniqueId = parentUniqueId;
	}


	public String getModel() {
		return model;
	}

	public void setModel(String model) {
		this.model = model;
	}

	
	public String getPartName() {
		return partName;
	}

	public void setPartName(String partName) {
		this.partName = partName;
	}
}
